#ifndef LINKED_LIST_H
#define LINKED_LIST_H

#include "../include/object.h"

class Node
{
public:
	Node();
	Node(hObject ele, Node *next, Node *prev);
	hObject ele;
	Node *next;
	Node *prev;
};

//template <class T>
class LinkedList
{
private:
	Node *head, *tail;
	int size;
	bool release_mem;
	
public:
	LinkedList();
	LinkedList(bool r_m);
	void push_back(hObject new_ele);
	void pop_back();
	int find(hObject ele, Node **node);
	void remove(Node *n);
	void remove(hObject ele);
	Node *getFirst();
	Node *getLast();
	Node *getNext(Node *cur);
	Node *getPrev(Node *cur);
	int getSize();
	void clear();
	~LinkedList();
};

#endif
